package com.naiterui.ehp.bs.pharmacist.repository.mysql;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bs.pharmacist.entity.PharmacistDrMedicationRecomInfo;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

/**
 * @Description 处方审核信息
 * @Author gongbaoqiang
 * @Date 2019/12/5 2:01 PM
 */
@Repository
public interface DrMedicationRecomInfoRepository extends BaseJpaRepository<PharmacistDrMedicationRecomInfo, Long> {

    /**
     * <pre>
     *     根据审核状态查询处方信息
     * </pre>
     *
     * @param status
     * @param pageable
     *
     * @return
     */
    Page<PharmacistDrMedicationRecomInfo> findByCheckingStatus(Integer status, Pageable pageable);

    /**
     * <pre>
     *     获取药师指定状态的处方信息
     * </pre>
     *
     * @param pharmacistId
     * @param status
     * @param pageable
     *
     * @return
     */
    Page<PharmacistDrMedicationRecomInfo> findByPharmacistIdAndCheckingStatus(Long pharmacistId, Integer status, Pageable pageable);

    /**
     * <pre>
     *     获取药师的全部处方信息
     * </pre>
     *
     * @param pharmacistId
     * @param pageable
     *
     * @return
     */
    Page<PharmacistDrMedicationRecomInfo> findByPharmacistId(Long pharmacistId, Pageable pageable);

    /**
     * <pre>
     *     查询处方审核信息详情
     * </pre>
     *
     * @param recomId
     *
     * @return
     */
    PharmacistDrMedicationRecomInfo findFirstByRecommendId(Long recomId);
}
